<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<div class="table-responsive">
	<table class="table table-striped table-bordered table-hover">
                                    <thead>
                                        <tr style="height: 45px;">
                                            <th class="center">姓名</th>
                                            <th class="center">性别</th>
                                            <th class="center">年龄</th>
                                            <th class="center">电话</th>
                                            <th class="center">学号</th>
                                            <c:if test="${bjid==null }">
	                                            <th class="center">班级</th>
	                                            <th class="center">班主任</th>
                                            </c:if>
                                            <th class="center">成绩</th>
                                        </tr>
                                    </thead>
                                    <tbody id="b1">
                                    <c:forEach items="${student}" var="c">
                                    	<c:if test="${c.student.bj.id==bjid||bjid==null }">
                                        <tr>
                                            <td class="center">${c.student.name }</td>
                                            <td class="center">${c.student.gender }${c.grade }</td>
                                            <td class="center">${c.student.age }</td>
                                            <td class="center">${c.student.number }</td>
                                            <td class="center">${c.student.sn }</td>
                                            <c:if test="${bjid==null }">
	                                           <td class="center">${c.student.bj.bjname }</td>
	                                           <td class="center">${c.student.bj.bjteacher }</td>
                                            </c:if>
                                            <td class="center">
                                            <c:if test="${bjid!=null }">
                                            	<input type="text"  onchange="fun(this.value,${c.id },${pageq },${bjid })" value="${c.grade }">
                                            </c:if>
                                            <c:if test="${bjid==null }">
                                            	<input type="text"  onchange="fun1(this.value,${c.id },${pageq })" value="${c.grade }">
                                            </c:if>
                                            </td>
                                        </tr>
                                        </c:if>
                                    </c:forEach>
                                    </tbody>
                                </table>
                                  &emsp;${xianshi }&emsp;<br>
								    ${sql }
								
</div>
<script type="text/javascript">
	function fun(grade,id,page,bjid){
		$.post("${pageContext.request.contextPath}/teacher/grandes?grade="+grade+"&id="+id+"&page="+page+"&bjid="+bjid);
	}
	function fun1(grade,id,page){
		$.post("${pageContext.request.contextPath}/teacher/grandes?grade="+grade+"&id="+id+"&page="+page);
	}
	function pages(page){
 		$('#b1').load('${pageContext.request.contextPath}/teacher/findall?page='+page);
 	}
 	function pages1(page,bjid){
 		$('#b1').load('${pageContext.request.contextPath}/teacher/findall?page='+page+'&bjid='+bjid);
 	}
</script>